const app = getApp();
Component({
  data: {
    userInfo:null,
    nickName:'',
    StatusBar: app.globalData.StatusBar,
    CustomBar: app.globalData.CustomBar
  },
  // options: {
  //   addGlobalClass: true,
  //   multipleSlots: true
  // },
  methods: {
    onLoad() {
      console.log("++++++++")
      let that = this;
      var userInfo = wx.getStorageSync('userInfo');
      var nickName = userInfo.userInfo.nickName
      that.setData({
        nickName: nickName
      })
      // 获取用户信息
      wx.getSetting({
        success: res => {
          if (!res.authSetting['scope.userInfo']) {
            wx.redirectTo({
              url: '/pages/index/index'
            })
          }
        }
      })
    }
  },
  pageLifetimes: {
    show() {
      console.log(123)
      if (typeof this.getTabBar === 'function' && this.getTabBar()) {
        this.getTabBar().setData({
          selected: 0
        })
      }
    }
  }
})